<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('物业报修列表')" />
	<style type="text/css">
		table th{
			max-width: 100px;
		}
		table td{
			max-width: 100px;
			overflow: hidden;
		}
		.readNumber{
			border-radius: 50%;
		}
	</style>
</head>
<body class="gray-bg">
	<div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="post-form">
					<div class="select-list">
						<ul>
							<li style="display: none;">
								问题：<input type="text" name="problem"/>
							</li>
							<li>
								学号：<input type="text" name="studentId"/>
							</li>


<!--							<li>-->
<!--								<label>业务分类：</label><select name="classID" th:with="type=${@dict.getStoryClass('story_class')}">-->
<!--								<option value="">所有</option>-->
<!--								<option th:each="dict : ${type}" th:text="${dict.className}" th:value="${dict.id}"></option>-->
<!--							</select>-->
<!--							</li>-->

<!--							<li>-->
<!--								<label>转交部门：</label><select name="departmentID" th:with="type=${@dict.getDepartment('department')}">-->
<!--								<option value="">所有</option>-->
<!--								<option th:each="dict : ${type}" th:text="${dict.dept_name}" th:value="${dict.dept_code}"></option>-->
<!--							</select>-->
<!--							</li>-->


							<li class="select-time">
								<label>提交时间： </label>
								<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="beginTime"/>
								<span>-</span>
								<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="endTime"/>
							</li>




							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="searchPre()"><i class="fa fa-search"></i>&nbsp;搜索</a>
							    <a class="btn btn-warning btn-rounded btn-sm" onclick="resetPre()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			
			<div class="btn-group-sm" id="toolbar" role="group">
<!--				<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:post:add">-->
<!--	                <i class="fa fa-plus"></i> 新增-->
<!--	            </a>-->
<!--				<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:post:edit">-->
<!--		            <i class="fa fa-edit"></i> 修改-->
<!--		        </a>-->
				<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:post:remove">
		            <i class="fa fa-remove"></i> 批量删除
		        </a>

				<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:story:export">
					<i class="fa fa-download"></i> 导出
				</a>
<!--				<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:post:export">-->
<!--		            <i class="fa fa-download"></i> 导出-->
<!--		        </a>-->
	        </div>
	        
	        <div class="col-sm-12 select-table table-striped">
			    <table id="bootstrap-table"></table>
			</div>
		</div>
	</div>
	<th:block th:include="include :: footer" />
	<script> var ctx2 = "\/story-ad/"; </script>
	<script th:inline="javascript">


		var editFlag = [[${@permission.hasPermi('system:post:edit')}]];
		var removeFlag = [[${@permission.hasPermi('system:post:remove')}]];
		var manageFlag = [[${@permission.hasPermi('property:user:view')}]];
		var datas = [[${@dict.getType('sys_normal_disable')}]];
		var prefix = ctx + "property/admin";
		var prefix2 = ctx + "story";
		var prefix3 = ctx2 + "story";
		// $(function(){/*...*/});是$(document).ready(function(){/*...*/})的简写形式，是在DOM加载完成后执行的回调函数，并且只会执行一次。
		$(function() {
		    var options = {
		        url: prefix + "/list/3",
		        createUrl: prefix + "/add",
		        updateUrl: prefix + "/edit/{id}",
		        removeUrl: prefix + "/remove",
		        exportUrl: prefix + "/export",
		        modalName: "物业报修",
		        columns: [{
		            checkbox: true
		        },
		        {
		            field: 'id',
		            title: '序号'
		        },
				{
					field: "keyId",
					title: '学/工号'
				},
		        {
		            field: 'typeName',
		            title: '类型',
		        },
		        {
		            field: 'userName',
		            title: '姓名',
		        },
		        {
		            field: 'storied',
		            title: '地点',

		        },
				{
					field: 'address',
					title: '地址',

				},
				{
					field: 'describe',
					title: '问题',

				},
				{
					formatter: function(value, row, index) {
						return $.table.selectDictLabel(datas, value);
					}
				},
		        {
		            field: 'createTime',
		            title: '提交时间',
					// sortable: true
		        },
				// {
				// 	field: 'mychatcount',
				// 	title: '未读信息'+'(<span style="color: #7a7fdd">'+[[${sumCount}]]+'</span>)',
				// 	sortable: true
				// },
				{
					field: 'orderStatus',
					title: '状态',
					formatter: function(value, row, index) {

						var actions = [];
						if(value == 'Y-02'){
							actions.push('<span style="color: darkseagreen">已接单</span>&nbsp;');
						}else if (value == 'Y-01'){
							actions.push('<span style="color: orangered">未接单</span>&nbsp;');
						}else if (value == 0){
							actions.push('<span style="color: orangered">未处理</span>&nbsp;');
						}else {
							actions.push('<span style="color: orangered">处理中</span>&nbsp;');
						}
						return actions.join('');
					}
				},
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		                var actions = [];
		                // actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
		                // actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id+'\')"><i class="fa fa-remove"></i>删除</a>&nbsp;');
						// actions.push('<a class="btn btn-warning btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="message2(' + row.id+')"><i class="fa fa-edit"></i>对话</a> ');
						// var more = [];
						actions.push("<a class='btn btn-primary btn-xs " + manageFlag + "' href='javascript:void(0)' onclick='manage(" + row.id + ")'><i class='fa fa-key'></i>反馈</a> ");
						// actions.push('<a tabindex="0" class="btn btn-info btn-xs" role="button" data-container="body" data-placement="left" data-toggle="popover" data-html="true" data-trigger="hover" data-content="' + more.join('') + '"><i class="fa fa-chevron-circle-right"></i>更多操作</a>');
						return actions.join('');
		            }
		        }]
		    };
		    $.table.init(options);



		});


		/* 管理进度 */
		function manage(id) {
			// var url = prefix + '/manage/' + id;
			// var ss = problem;
			//第一个参数是标签的名称
			// $.modal.openTab("进度管理", url);
			$.modal.open('反馈指示', prefix + "/feedback/"+id, '666', '500');

		}
		/* 聊天管理 */
		function message2(id) {
			var url = prefix3 + '/chatsearch/' + id+"?userId="+120724;
			// var ss = problem;
			//第一个参数是标签的名称
			$.modal.openTab("聊天管理", url);
		}
		// $("#myselect").change(function(){
		// 	var opt=$("#myselect").val();
		// 	alert(opt);
		// });
		function searchPre() {
			var data = {};

			$.table.search('post-form', 'bootstrap-table', data);
		}


		function resetPre() {
			$("#post-form")[0].reset();
			$.table.search('post-form', 'bootstrap-table');
		}



	</script>
</body>
</html>